

import 'package:erp/Entity/Customer.dart';
import 'package:erp/Entity/CustomerType.dart';
import 'package:erp/Entity/Product.dart';
import 'package:erp/Entity/CountResult.dart';
import 'package:erp/Entity/ProductDetailAtPurchaseOrSell.dart';
import 'package:erp/Entity/ProductInWareHouse.dart';
import 'package:erp/Entity/ProductType.dart';
import 'package:erp/Entity/PurchaseOrder.dart';
import 'package:erp/Entity/SalesDetailsProductGroup.dart';
import 'package:erp/Entity/SalesOrder.dart';
import 'package:erp/Entity/ServerResponse.dart';
import 'package:erp/Entity/ServerTime.dart';
import 'package:erp/Entity/SignInResult.dart';
import 'package:erp/Entity/Supplier.dart';
import 'package:erp/Entity/SupplierType.dart';
import 'package:erp/Entity/WareHouse.dart';

abstract class Interfaces {
  void getTime(void callback(ServerTime time));
  void signIn(String userName, String password, void callback(ServerResponse<SignInResult> signInResult));

  Future<CountResult> getAllProductCount(String token);
  Future<List<Product>> getProducts(String token, [int pageIndex = 0]);
  Future<Product> addProduct(String token, Product product);
  Future<String> generateNewProductCode(String token);
  Future<Product> updateProduct(String token, Product product);
  Future<void> deleteProduct(String token, Product product);

  Future<List<ProductType>> getProductTypes(String token);
  Future<ProductType> addProductType(String token, ProductType type);
  Future<ProductType> updateProductType(String token, ProductType type);
  Future<ProductType> deleteProductType(String token, ProductType type);

  Future<CountResult> getAllSupplierCount(String token);
  Future<List<Supplier>> getSuppliers(String token, [int pageIndex = 0]);
  Future<Supplier> addSupplier(String token, Supplier supplier);
  Future<Supplier> updateSupplier(String token, Supplier supplier);
  Future<Supplier> deleteSupplier(String token, Supplier supplier);

  Future<List<SupplierType>> getAllSupplierTypes(String token);
  Future<SupplierType> addSupplierType(String token, SupplierType data);
  Future<SupplierType> updateSupplierType(String token, SupplierType data);
  Future<SupplierType> deleteSupplierType(String token, SupplierType data);

  Future<CountResult> getAllWareHouseCount(String token);
  Future<WareHouse> addWareHouses(String token, WareHouse data);
  Future<List<WareHouse>> getWareHouses(String token, [int pageIndex = 0]);
  Future<WareHouse> updateWareHouses(String token, WareHouse data);
  Future<WareHouse> deleteWareHouses(String token, WareHouse data);

  Future<CountResult> getAllPurchaseOrderCount(String token);
  Future<List<PurchaseOrder>> getPurchaseOrders(String token, [int pageIndex = 0]);
  Future<PurchaseOrder> addPurchaseOrder(String token, PurchaseOrder order);
  Future<List<ProductDetailAtPurchaseOrSell>> getPurchaseOrderDetails(String token, PurchaseOrder order);
  Future<List<ProductDetailAtPurchaseOrSell>> getProductsInPurchaseOrder(String token, PurchaseOrder order);

  Future<List<CustomerType>> getCustomerTypes(String token);
  Future<CustomerType> addCustomerType(String token, CustomerType customerType);
  Future<CustomerType> updateCustomerType(String token, CustomerType customerType);
  Future<bool> deleteCustomerType(String token, CustomerType customerType);

  Future<List<Customer>> getAllCustomers(String token);
  Future<Customer> addCustomer(String token, Customer customer);
  Future<Customer> updateCustomer(String token, Customer customer);
  Future<Customer> deleteCustomer(String token, Customer customer);

  Future<List<SalesOrder>> getAllSalesOrders(String token);
  Future<SalesOrder> addSalesOrder(String token, SalesOrder order);
  Future<List<ProductDetailAtPurchaseOrSell>> getProductGroupsInSalesOrder(String token, SalesOrder order);

  Future<List<ProductInWareHouse>> getAllProductsInWareHouse(String token);
  Future<ProductInWareHouse> editProductInWareHouse(String token, ProductInWareHouse product);
  Future<ProductInWareHouse> editPriceOfProductInWareHouse(String token, ProductInWareHouse product);
  Future<ProductInWareHouse> deleteProductInWareHouse(String token, ProductInWareHouse product);
}

